package com.ruibang.glass.sale.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruibang.glass.sale.domain.req.GSaleContractManReq;
import com.ruibang.glass.sale.domain.req.GSaleStatisticsManReq;
import com.ruibang.glass.sale.domain.req.SalePayProgressReq;
import com.ruibang.glass.sale.domain.req.SaleshippingApplicationReq;
import com.ruibang.glass.sale.dto.*;
import com.ruibang.glass.sale.entity.GSaleBackHouseOrder;
import com.ruibang.glass.sale.entity.GSaleOrderManagement;
import com.ruibang.glass.sale.entity.SaleShippingApplication;
import com.ruibang.glass.sale.entity.SalesShippingItems;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 发货申请记录表 Mapper 接口
 * </p>
 *
 * @author mameng
 * @since 2024-03-30
 */
@Mapper
public interface SaleShippingApplicationMapper extends BaseMapper<SaleShippingApplication> {

    IPage<SaleShippingApplication> moreList(IPage<SaleShippingApplication> page, @Param("saleshippingApplicationReq") SaleshippingApplicationReq saleshippingApplicationReq);

    List<SaleShippingApplication> getMoreSelectList();

    IPage<GSaleShappingDTO> getNewPage(IPage<GSaleContractManagementDTO> page, @Param("gSaleCustomerManReq") GSaleContractManReq gSaleCustomerManReq);

    List<GSaleShappingDTO> getSumAmountByNumber(@Param("numberList") List<String> numberList);

    /**
     * 销售业绩
     */
    List<StatisticOrderDTO> getStatisticOrderDTOByYear(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    List<StatisticOrderDTO> getStatisticOrderDTOByMonth(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * 销售业绩季度
     */
    List<StatisticOrderDTO> getStatisticOrderDTOByJD(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * 销售总额年份
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticAllAmountOrderDTOByYear(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * 待发货
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticDFHAmountOrderDTOByYear(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * 待发货
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticYFHAmountOrderDTOByYear(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * 销售总额年份
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticAllAmountOrderDTOByMonth(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * 待发货
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticDFHAmountOrderDTOByMonth(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * yfh
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticYFHAmountOrderDTOByMonth(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * 销售总额年份
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticAllAmountOrderDTOByJD(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * 待发货
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticDFHAmountOrderDTOByJD(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);

    /**
     * yfh
     *
     * @param saleStatisticsManReq
     * @return
     */
    List<StatisticOrderDTO> getStatisticYFHAmountOrderDTOByJD(@Param("saleStatisticsManReq") GSaleStatisticsManReq saleStatisticsManReq);


    /**
     * 收款进度 饼图未支付
     *
     * @param salePayProgressReq
     * @return
     */
    BigDecimal getNoPay(@Param("saleStatisticsManReq") SalePayProgressReq salePayProgressReq);

    /**
     * 收款进度 饼图已支付
     *
     * @param salePayProgressReq
     * @return
     */
    BigDecimal getYesPay(@Param("saleStatisticsManReq") SalePayProgressReq salePayProgressReq);

    List<SaleLineAmountDTO> getLineAmountBYYearList(@Param("saleStatisticsManReq") SalePayProgressReq salePayProgressReq);

    List<SaleLineAmountDTO> getLineAmountBYMonthList(@Param("saleStatisticsManReq") SalePayProgressReq salePayProgressReq);

    List<SaleLineAmountDTO> getLineAmountBYJDList(@Param("saleStatisticsManReq") SalePayProgressReq salePayProgressReq);

    /**
     * 异议处理 年
     *
     * @param salePayProgressReq
     * @return
     */
    List<GSaleDisputeLineDTO> getGSaleDisputeLineDTOList(@Param("salePayProgressReq") SalePayProgressReq salePayProgressReq);

    /**
     * 异议处理 月
     *
     * @param salePayProgressReq
     * @return
     */
    List<GSaleDisputeLineDTO> getGSaleDisputeLineMonthDTOList(@Param("salePayProgressReq") SalePayProgressReq salePayProgressReq);

    /**
     * 异议处理 季度
     *
     * @param salePayProgressReq
     * @return
     */
    List<GSaleDisputeLineDTO> getGSaleDisputeLineJDDTOList(@Param("salePayProgressReq") SalePayProgressReq salePayProgressReq);


    SalesShippingItems getWareHouseAndId( @Param("batchNumber") String batchNumber);

    SalesShippingItems getWareHouseName(@Param("id") String id);

    List<SalesShippingItems> getSalesShippingItemsByNumber(@Param("ids") List<String> ids);

    List<SalesShippingItems> getATypeList(@Param("salesShippingItems") SalesShippingItems salesShippingItems,@Param("ids") List<String> ids);

    void updateByLevelRack(@Param("quality") BigDecimal quality, @Param("levelRack") String levelRack);


}
